package com.ruoyi.project.applet.mapper;

import com.ruoyi.project.applet.domain.Record;
import com.sun.jna.platform.win32.WinDef;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RecordMapper {

    List<Record> selectByIssend(long u_id);

    //通过id修改消息为已发送
    Integer updateById(@Param("r_id")long r_id);

    //判断消息记录里是否有两人记录
    long isrecord(@Param("from_id") long from_id, @Param("to_id") long to_id);

    Integer add(@Param("fromId")long from_id, @Param("toId")long to_id, @Param("recordContent")String r_content, @Param("recordType")Integer r_type, @Param("chatId")String chatid, @Param("createTime")String r_createTime);

    //通过from id修改消息为已读
    Integer updateread(@Param("from_id") long from_id,@Param("to_id") long to_id);

    //查询俩人聊天记录的会话id
    List<Record> selectByfromto(@Param("from_id") long from_id,@Param("to_id") long to_id);


    List<Record> selectBychatid1(@Param("chatid")String chatid);

    //通过会话id查询聊天记录

    List<Record> selectBychatid(@Param("chatid") String chatid,
                                @Param("id") int id);
}
